package com.ruoyi.warehouse.controller;


import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.warehouse.domain.KcxqInventoryDetails;
import com.ruoyi.warehouse.domain.LlslIncomingMaterials;
import com.ruoyi.warehouse.domain.WldaMaterialFile;
import com.ruoyi.warehouse.service.YlkcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import com.ruoyi.common.core.web.controller.BaseController;



/**
 * 原料库存Controller
 *
 * @author ruoyi
 * @date 2024-06-27
 */
@RestController
@RequestMapping("/ylkc")
public class YlkcController extends BaseController {

    @Autowired
    private YlkcService ylkcService;

    /**
     *  查询原料库存列表
     * */
    @RequiresPermissions("warehouse:ylkc:list")
    @GetMapping("/ylkclist")
    public TableDataInfo ylkcList(WldaMaterialFile wldaMaterialFile)
    {
        startPage();
        List<KcxqInventoryDetails> list = ylkcService.selectYlkcList(wldaMaterialFile);
        return getDataTable(list);
    }

    /**
     *  查询消耗记录列表
     * */
    @RequiresPermissions("warehouse:ylkc:consume")
    @GetMapping("/consumeList/{wlCode}")
    public TableDataInfo consumeList(@PathVariable String[] wlCode)
    {
        startPage();
        List<LlslIncomingMaterials> list = ylkcService.consumeList(wlCode);
        return getDataTable(list);
    }

    /**
     *  查询来料记录列表
     * */
    @RequiresPermissions("warehouse:ylkc:increase")
    @GetMapping("/increaseList/{wlCode}")
    public TableDataInfo increaseList(@PathVariable String[] wlCode)
    {
        startPage();
        List<LlslIncomingMaterials> list = ylkcService.increaseList(wlCode);
        return getDataTable(list);
    }

    /**
     *  查询库存详情列表
     * */
    @RequiresPermissions("warehouse:ylkc:inventory")
    @GetMapping("inventoryList/{wlCode}")
    public TableDataInfo inventoryList(@PathVariable String[] wlCode)
    {
        startPage();
        List<KcxqInventoryDetails> list = ylkcService.inventoryList(wlCode);
        return getDataTable(list);
    }

}
